fix: default-config tier from 2026-06-10 audit#254
Conversation
Soft-gate reschedules (rate limit, circuit breaker, concurrency cap, channel backpressure) called storage.retry(), which increments retry_count for a job that never executed — exhausting its retry budget and dead-lettering it on the first real failure. Add a reschedule() Storage method that resets to Pending without incrementing, and route the gate paths to it; retry() stays for genuine post-execution failures.
Webhook subscriptions store plaintext HMAC secrets (and delivery logs store request payloads) under webhooks: keys in the same store as /api/settings, which only redacted auth:. Any viewer could read them. Add webhooks: to the protected prefixes.
NaN/Infinity passed notes validation and json.dumps (allow_nan default) emitted bare Infinity/NaN tokens — invalid JSON that breaks the dashboard jobs API. Reject non-finite floats in _validate_value and pass allow_nan=False.
JobResult.to_dict emitted the parsed notes dict, but the dashboard API contract is notes: string | null and the client JSON.parse-s it — crashing the job detail page. Emit the raw canonical JSON string instead.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThis PR introduces a new ChangesJob Rescheduling and Soft-Gate Handling
Notes Validation and Serialization
Settings Access Control
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Fixes the four findings from the 2026-06-10 codebase audit that affect a default deployment (thread pool, SQLite, dashboard). One focused commit per finding.
#15 — soft-gate reschedules burned retry budget (scheduler)
Rate-limit / circuit-breaker / concurrency-cap / channel-backpressure gates called
storage.retry(), which incrementsretry_countfor a job that never executed — exhausting its budget and dead-lettering it on the first real failure. Backpressure fires under ordinary load, so this is default-reachable.New
reschedule(id, next_at)Storage method =retry()minus theretry_countincrement, wired across the trait,diesel_commonmacro, Redis backend,impl_storage!, anddelegate!. Poller gate paths route to it;result_handlerkeepsretry()for genuine post-execution failures. Helper renamedrollback_claim_and_reschedule.#4 — webhook HMAC secrets leaked via GET /api/settings (dashboard)
Webhook subscriptions (plaintext signing secret) and delivery logs live under
webhooks:keys in the same store as/api/settings, which only redactedauth:. Any authenticated viewer could read them. Addedwebhooks:to_PROTECTED_PREFIXES.#5 — notes type drift crashed the job detail page (dashboard)
JobResult.to_dictemitted the parsednotesdict, but the API contract isnotes: string | nulland the clientJSON.parse-s it — crashing the Overview tab for any job with notes.to_dictnow emits the raw canonical JSON string; thenotesproperty stays a dict for Python callers.#43 — NaN/Infinity notes produced invalid JSON
Non-finite floats passed validation and
json.dumps(defaultallow_nan=True) emitted bareInfinity/NaNtokens that break the jobs API response. Rejected in_validate_value(math.isfinite) plusallow_nan=Falseas a safety net.Verification
cargo test --workspace(84 sqlite + new contracttest_reschedule), clippy clean, postgres/redis feature builds compiletest_reschedule_preserves_retry_count,test_reschedule,test_get_settings_hides_webhook_keys,test_to_dict_emits_notes_as_json_string,test_non_finite_floats_rejectedSummary by CodeRabbit
Release Notes
New Features
Improvements